package org.authsum.stitches.wicket;

import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.spring.injection.annot.SpringBean;
import org.apache.wicket.spring.injection.annot.SpringComponentInjector;
import org.authsum.stitches.services.StitchesService;
import org.authsum.stitches.main.*;
/**
 * Application object for your web application. If you want to run this application without deploying, run the Start class.
 * 
 * @see wicket.myproject.Start#main(String[])
 * 
 * 
 * I inject the stitchservice here since we are having problems persisting it on the pages, components
 * 
 * http://cwiki.apache.org/WICKET/spring.html
 * 
 * 
 */
public class WicketApplication extends WebApplication
{    
	
    public StitchesPropertyHolder getStitchesPropertyHolder() {
		return stitchesPropertyHolder;
	}

	public void setStitchesPropertyHolder(
			StitchesPropertyHolder stitchesPropertyHolder) {
		this.stitchesPropertyHolder = stitchesPropertyHolder;
	}

	public void init() {
        super.init();
        addComponentInstantiationListener(new SpringComponentInjector(this));
    }
/*
 * 
 * 	protected StitchesService stitchesService;

	public StitchesService getStitchesService() {
		return stitchesService;
	}

	public void setStitchesService(StitchesService stitchesService) {
		this.stitchesService = stitchesService;
	}
*/
    
    private StitchesPropertyHolder stitchesPropertyHolder = null;
    


    
    /**
     * Constructor
     */
	public WicketApplication()
	{
	}
	
	/**
	 * @see wicket.Application#getHomePage()
	 */
	public Class getHomePage()
	{
		return HomePage.class;
	}

}
